﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace LibraryHub.DataAccess.EntityFramework
{
    public class EfUser
    {
        public int Id { get; set; }

        [Required]
        [MinLength(3)]
        [MaxLength(30)]
        public string Login { get; set; }

        [Required]
        [MinLength(5)]
        [MaxLength(64)]
        public string Password { get; set; }

        [Required]
        [MinLength(1)]
        [MaxLength(64)]
        public string FullName { get; set; }

        [Required]
        public int Role { get; set; }
        
        public virtual ICollection<EfLibraryOperation> Operations { get; set; }
        
        
        public EfUser()
        {
            Operations = new List<EfLibraryOperation>();
        }
    }
}